/**  
 *	VisualGroup JavaScript prototype Classes, version 0.1
 *  (c) 2006 Bill Vison <vison_ruan@126.com>
 *	Load the data use Logger Defined
 *
 *
/*--------------------------------------------------------------------------*/
using("Vsg.Common");
Vsg.Common.Format = Ext.util.Format;
Vsg.Common.Format.cnMoney = function(v) {
	
	var v = (Math.round((v-0)*100))/100;

    v = (v == Math.floor(v)) ? v + ".00" : ((v*10 == Math.floor(v*10)) ? v + "0" : v);

    v = String(v);

    var ps = v.split('.');

    var whole = ps[0];

    var sub = ps[1] ? '.'+ ps[1] : '.00';

	var r = /(\d+)(\d{3})/;

    while (r.test(whole)) {

    	whole = whole.replace(r, '$1' + ',' + '$2');

    }

    v = whole + sub;

    if(v.charAt(0) == '-'){

    	return '-&yen;' + v.substr(1);

    }

    return "&yen;" +  v;

	
}
